package world;

import main.Main.Team;

public class Spawn {

	float x, y;

	/**
	 * Constructor of Spawn. Creates a spawnpoint at the location (x, y).
	 * @param x The x-coordinate of 
	 * @param y
	 */
	public Spawn(float x, float y) {
		this.x = x; this.y = y;
	}
	
	/**
	 * Create a player and spawn the player at the location of this spawn.
	 * @param team
	 * @return
	 */
	public Player createPlayer(Team team) {
		Player p = new Player(team);
		spawnPlayer(p);
		return p;
	}
	
	/**
	 * Spawn player att the location of this spawn.
	 * @param p Player to spawn.
	 */
	public void spawnPlayer(Player p) {
		p.moveTo(x, y);
		p.setAlive(true);
	}
}
